home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm4_1_2
- Caption = "Arithmetic"
- ClientHeight = 1680
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 3690
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1680
- ScaleWidth = 3690
- Begin VB.PictureBox picResult
- Height = 855
- Left = 120
- ScaleHeight = 795
- ScaleWidth = 3435
- TabIndex = 1
- Top = 120
- Width = 3495
- End
- Begin VB.CommandButton cmdAdd
- Caption = "Add Numbers"
- Height = 375
- Left = 600
- TabIndex = 0
- Top = 1200
- Width = 2415
- End
- Attribute VB_Name = "frm4_1_2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdAdd_Click()
- 'Display the sum of two numbers
- picResult.Cls
- Call ExplainPurpose
- picResult.Print
- Call Add(2, 3)
- End Sub
- Private Sub Add(num1 As Single, num2 As Single)
- 'Display numbers and their sum
- picResult.Print "The sum of"; num1; "and"; num2; "is"; num1 + num2
- End Sub
- Private Sub ExplainPurpose()
- 'Explain the task performed by the program
- picResult.Print "This program displays a sentence"
- picResult.Print "identifying two numbers and their sum."
- End Sub
-